
import { getTrainingProgram, getTrainingCourse, loadEvaluateTeachTaskJoinListInfo } from "../../../services/trainingProgram"
export default {

  namespace: 'teachingTaskModule',
  state: {
    list: "",
    course: []
  },

  effects: {
    *loadEvaluateTeachTaskJoinList({ payload }, { call, put }) {
      let { rows } = yield loadEvaluateTeachTaskJoinListInfo({ order: 'asc', page: 1, rows: 100, isTea: 1 })
      yield put({
        type: "setList",
        payload: rows
      })
    },

    *fetch({ payload }, { call, put }) {  // eslint-disable-line
      yield put({ type: 'save' });
    },
  },

  reducers: {
    setList(state, { payload }) {
      state.list = payload
      return { ...state, ...payload };
    },
    setCourse(state, { payload }) {
      state.course = payload
      return { ...state, ...payload };
    },
  },

};
